package com.leyou.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.leyou.service.BrandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pojo.Brand;

import java.util.List;

@RestController
@RequestMapping("/brand")
@CrossOrigin
public class BrandController {

    @Autowired
    private BrandService brandService;
    @RequestMapping()
    public List<Brand> findAll(){
        return brandService.findAll();
    }
    @GetMapping("/{page}/{size}")
    public IPage<Brand> findAll(@PathVariable  Integer page, @PathVariable  Integer size){
        return brandService.findByPage(page,size);
    }
}
